
import os

def convert_to_jpg(folder_path):
    for filename in os.listdir(folder_path):
        filepath = os.path.join(folder_path, filename)
        if os.path.isfile(filepath):
            os.rename(filepath,os.path.join(folder_path, filename.split(".")[0]+".xml"))


# 调用示例
folder_path = r'E:\finalshell下载\xml'
convert_to_jpg(folder_path)
print("完成")